<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>新增</title>
</head>
<body>
<div class="pd-20">
	<form action="<%=path%>/backstage/resource-add" method="post" class="form form-horizontal" id="form-u_resource-add">
		<input type="hidden" id="id" name="id" value='${u_resource.resource_id}' />
		<input type="hidden" id="type" name="type" value='${u_resource.type}' />
        <input type="hidden" id="web_path" name="web_path" value="<%=path%>"/> 
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">名称：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <input type="text" class="input-text" value="${u_resource.res_name}" placeholder="" id="" name="res_name" datatype="*" nullmsg="不能为空">
        	</div>
        </div>
  
        <div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">资源地址：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <input type="text" class="input-text" value="${u_resource.res_url}" placeholder="" id="" name="res_url" datatype="*" nullmsg="不能为空">
        	</div>
		</div>
		
	 	<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">资源：</label>
			<div class="formControls col-xs-8 col-sm-5">
			     <div id="filePicker_pre">选择资源</div>
				<div id="fileList_pre" class="uploader-list"></div>
				<input type="hidden" class="input-text"
				value="${u_resource.res_image}" placeholder=""
				id="res_image" name="res_image" datatype="*" nullmsg="不能为空" >
			</div>
		</div>
		
		 <div class="row cl">
        	<label class="form-label col-xs-4 col-sm-3"></label>
			<div class="formControls col-xs-8 col-sm-5" id="show_type">
			<c:if test="${u_resource.type == 1}">
				<audio controls="controls">
					<source src="${u_resource.res_image}" type="audio/mpeg">
				</audio>	
			</c:if>
			<c:if test="${u_resource.type == 2}">
				<img src="${u_resource.res_image}"  id="pre_img"  style="width:100px; height:100px" />	
			</c:if>
			</div>
		</div>
		
		
		
               
		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button onClick="u_resource_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i>保存</button>
				
			</div>
		</div>
	</form>
</div>

<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script>
<script type="text/javascript" src="js/u_resource.js"></script> 
<script type="text/javascript">

function u_resource_save_submit(){
	$("#form-u_resource-add").Validform({
		tiptype:2,
		ajaxPost:true,
		callback:function(form){
			var index = parent.layer.getFrameIndex(window.name);
			if (index){//关闭弹出层
				parent.$('.btn-refresh').click(); 
				parent.layer.close(index);
			}else{//单独的页面
				location.href = "<%=path%>/backstage/u_resource-list"; 
			}
		}
	});
}

</script>
</body>
</html>

